package com.only4play.system.web;

import com.only4play.common.model.EnumVo;
import com.only4play.common.model.JsonObject;
import com.only4play.common.utils.EnumDictUtils;
import com.only4play.productcenter.api.constants.ComponentType;
import com.only4play.productcenter.api.constants.DirectionType;
import com.only4play.productcenter.api.goods.service.GoodsFeignService;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hinzzz www.hinzzz.cn 157957329@qq.com
 * 2024-02-27
 */
@RestController
@RequestMapping(value = "dict")
@Schema(title = "字典")
@RequiredArgsConstructor
public class DictController {

    private final GoodsFeignService goodsFeignService;


    @GetMapping(value = "componentType")
    public JsonObject<List<EnumVo>> componentType() {
        return JsonObject.success(EnumDictUtils.getEnumDictVo(ComponentType.class));
    }

    @GetMapping(value = "directionType")
    public JsonObject<List<EnumVo>> directionType(){
      return JsonObject.success(EnumDictUtils.getEnumDictVo(DirectionType.class));
    }


}

